package com.oocl.euc.core.maintenance.controller;

import com.oocl.euc.core.maintenance.model.Team;
import com.oocl.euc.core.maintenance.service.TeamService;
import com.oocl.euc.framework.base.controller.RESTController;
import com.oocl.euc.framework.base.service.BaseService;
import com.oocl.euc.framework.common.utils.ResponseEntityUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/rest/teamList")
public class TeamController extends RESTController<Team, Long> {

    @Autowired
    TeamService teamService;

    @Override
    protected BaseService<Team, Long> getBaseService() {
        return teamService;
    }

    @RequestMapping("/all")
    public ResponseEntity findAll() {
        List<Team> teamList = teamService.findAll();
        return ResponseEntityUtil.successInRestful(teamList);
    }
}
